﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.IO;
using System.Globalization;
using System.Drawing;
using System.Text;

namespace SAFP
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Localization.LoadLanguage();
            Application.Run(new MainForm());
        }
        public static void CreateSettingsFile()
        {
            FileStream file=File.Create("settings.ini");
            file.Close();
            StringBuilder sb = new StringBuilder();

            CultureInfo ci = CultureInfo.InstalledUICulture;
            sb.AppendLine("language=" + ci.TwoLetterISOLanguageName);

            Rectangle resolution = Screen.PrimaryScreen.Bounds;
            sb.AppendLine("resolutionx=" + resolution.Width);
            sb.AppendLine("resolutiony=" + resolution.Height);

            sb.AppendLine("graphics=low");

            using (StreamWriter outfile = new StreamWriter("settings.ini"))
            {
                outfile.Write(sb.ToString());
            }
        }
        public static int UserID = 0;
        public static bool OfflineMode = false;
    }
}
